﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using VideoNet.Common;

namespace VideoNet.MyControls
{
    public partial class PicUserControl : UserControl
    {
        public PicUserControl()
        {
            InitializeComponent();
        }
        public void RefreshForm(List<CZUserInfo> users, string dicPath)
        {
            int i = 0;
            foreach (var user in users)
            {
                switch (i)
                {
                    case 0: this.pictureBox1.Image = Image.FromFile(dicPath + user.ImagePath); break;
                    case 1: this.pictureBox2.Image = Image.FromFile(dicPath + user.ImagePath); break;
                    case 2: this.pictureBox3.Image = Image.FromFile(dicPath + user.ImagePath); break;
                    case 3: this.pictureBox4.Image = Image.FromFile(dicPath + user.ImagePath); break;
                }
                i++;
            }
            switch (i)
            {
                case 0: this.pictureBox1.Image = this.pictureBox2.Image = this.pictureBox3.Image = this.pictureBox4.Image = null; break;
                case 1: this.pictureBox2.Image = this.pictureBox3.Image = this.pictureBox4.Image = null; break;
                case 2: this.pictureBox3.Image = this.pictureBox4.Image = null; break;
                case 3: this.pictureBox4.Image = null; break;
            }
        }
    }
}
